#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""This module contains utility functions for the WaterSupply optimization model.
"""

from itertools import product
from typing import List, Tuple, Union


def cartesian_product(
    *args : List[Union[int, str]]
) -> List[Tuple[Union[int, str]]]:
    """Generate cartesian product of input iterables.

    Parameters
    ----------
    args : List[Union[int, str]]
        Iterables to be combined.

    Returns
    -------
    List[Tuple[Union[int, str]]]
        List of tuples representing the Cartesian product.

    Examples
    --------
    Combine two lists [1, 2] and [7, 8]:

    >>> cartesian_product([1, 2], [7, 8])
    [(1, 7), (1, 8), (2, 7), (2, 8)]

    """
    return list(product(*args))